﻿using UnityEngine;
using System.Collections;

public class GameEngine : MonoBehaviour
{
    private Timer timer;

    private void Awake()
    {

    }


    // Use this for initialization
    void Start()
    {
        timer = TimerMgr.instance.CreateTimer(1, 1, () =>
        {
            Debug.Log("timer");
        });
        timer.Start();

        //timer.Stop();
    }

    // Update is called once per frame
    void Update()
    {
        //lua.Update();
        TimerMgr.instance.Loop(Time.deltaTime);

        if (Input.GetKeyDown(KeyCode.A))
        {
            if (timer.IsRunning) { timer.Stop(); }
            else { timer.Start(); }
        }
    }

    private void FixedUpdate()
    {

    }
}
